﻿using System;
using Newtonsoft.Json;
using OrkutAPILibrary.Enums;

namespace OrkutAPILibrary.Entities
{
    /// <summary>
    /// Orkut Person with all his details
    /// </summary>
    public class OrkutPerson
    {
        /// <summary>
        /// Gets or sets the turn ons.
        /// </summary>
        /// <value>The turn ons.</value>
        [JsonProperty(PropertyName = "turnOns")]
        public string[] TurnOns { get; internal set; }

        /// <summary>
        /// Gets or sets the turn offs.
        /// </summary>
        /// <value>The turn offs.</value>
        [JsonProperty(PropertyName = "turnOffs")]
        public string[] TurnOffs { get; internal set; }

        /// <summary>
        /// Gets or sets the sports.
        /// </summary>
        /// <value>The sports.</value>
        [JsonProperty(PropertyName = "sports")]
        public string[] Sports { get; internal set; }

        /// <summary>
        /// Gets or sets the languages spoken.
        /// </summary>
        /// <value>The languages spoken.</value>
        [JsonProperty(PropertyName = "languagesSpoken")]
        public string[] LanguagesSpoken { get; internal set; }

        /// <summary>
        /// Gets or sets the activities.
        /// </summary>
        /// <value>The activities.</value>
        [JsonProperty(PropertyName = "activities")]
        public string[] Activities { get; internal set; }

        /// <summary>
        /// Gets or sets the books.
        /// </summary>
        /// <value>The books.</value>
        [JsonProperty(PropertyName = "books")]
        public string[] Books { get; internal set; }

        /// <summary>
        /// Gets or sets the food.
        /// </summary>
        /// <value>The food.</value>
        [JsonProperty(PropertyName = "food")]
        public string[] Food { get; internal set; }

        /// <summary>
        /// Gets or sets the interests.
        /// </summary>
        /// <value>The interests.</value>
        [JsonProperty(PropertyName = "interests")]
        public string[] Interests { get; internal set; }

        /// <summary>
        /// Gets or sets the movies.
        /// </summary>
        /// <value>The movies.</value>
        [JsonProperty(PropertyName = "movies")]
        public string[] Movies { get; internal set; }

        /// <summary>
        /// Gets or sets the tv shows.
        /// </summary>
        /// <value>The tv shows.</value>
        [JsonProperty(PropertyName = "tvShows")]
        public string[] TvShows { get; internal set; }

        /// <summary>
        /// Gets or sets the music.
        /// </summary>
        /// <value>The music.</value>
        [JsonProperty(PropertyName = "music")]
        public string[] Music { get; internal set; }

        /// <summary>
        /// Gets or sets the urls.
        /// </summary>
        /// <value>The urls.</value>
        [JsonProperty(PropertyName = "urls")]
        public Urls[] Urls { get; internal set; }

        /// <summary>
        /// Gets or sets the phone numbers.
        /// </summary>
        /// <value>The phone numbers.</value>
        [JsonProperty(PropertyName = "phoneNumbers")]
        public PhoneNumbers[] PhoneNumbers { get; internal set; }

        /// <summary>
        /// Gets or sets the current location.
        /// </summary>
        /// <value>The current location.</value>
        [JsonProperty(PropertyName = "currentLocation")]
        public Address CurrentLocation { get; internal set; }

        /// <summary>
        /// Gets or sets the home address.
        /// </summary>
        /// <value>The home address.</value>
        [JsonProperty(PropertyName = "addresses")]
        public Address[] HomeAddress { get; internal set; }

        /// <summary>
        /// Gets or sets the gender.
        /// </summary>
        /// <value>The gender.</value>
        [JsonProperty(PropertyName = "gender")]
        public string Gender { get; internal set; }

        /// <summary>
        /// Gets or sets the profile URL.
        /// </summary>
        /// <value>The profile URL.</value>
        [JsonProperty(PropertyName = "profileUrl")]
        public string ProfileUrl { get; internal set; }

        /// <summary>
        /// Gets or sets the is viewer.
        /// </summary>
        /// <value>The is viewer.</value>
        [JsonProperty(PropertyName = "isViewer")]
        public string IsViewer { get; internal set; }

        /// <summary>
        /// Gets or sets the humor.
        /// </summary>
        /// <value>The humor.</value>
        [JsonProperty(PropertyName = "humor")]
        public string Humor { get; internal set; }

        /// <summary>
        /// Gets or sets the fashion.
        /// </summary>
        /// <value>The fashion.</value>
        [JsonProperty(PropertyName = "fashion")]
        public string Fashion { get; internal set; }

        /// <summary>
        /// Gets or sets the looking for.
        /// </summary>
        /// <value>The looking for.</value>
        [JsonProperty(PropertyName = "lookingFor")]
        public Interests[] LookingFor { get; internal set; }

        /// <summary>
        /// Gets or sets the romance.
        /// </summary>
        /// <value>The romance.</value>
        [JsonProperty(PropertyName = "romance")]
        public string Romance { get; internal set; }

        /// <summary>
        /// Gets or sets the status.
        /// </summary>
        /// <value>The status.</value>
        [JsonProperty(PropertyName = "status")]
        public string Status { get; set; }

        /// <summary>
        /// Gets or sets the about me.
        /// </summary>
        /// <value>The about me.</value>
        [JsonProperty(PropertyName = "aboutMe")]
        public string AboutMe { get; set; }

        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>The id.</value>
        [JsonProperty(PropertyName = "id")]
        public string Id { get; internal set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        [JsonProperty(PropertyName = "name")]
        public OrkutFullName Name { get; internal set; }

        /// <summary>
        /// Gets or sets the relationship status.
        /// </summary>
        /// <value>The relationship status.</value>
        [JsonProperty(PropertyName = "relationshipStatus")]
        public string RelationshipStatus { get; internal set; }

        /// <summary>
        /// Gets or sets the living arrangement.
        /// </summary>
        /// <value>The living arrangement.</value>
        [JsonProperty(PropertyName = "livingArrangement")]
        public string LivingArrangement { get; internal set; }

        /// <summary>
        /// Gets or sets the display name.
        /// </summary>
        /// <value>The display name.</value>
        [JsonProperty(PropertyName = "displayName")]
        public string DisplayName { get; internal set; }

        /// <summary>
        /// Gets or sets the thumbnail URL.
        /// </summary>
        /// <value>The thumbnail URL.</value>
        [JsonProperty(PropertyName = "thumbnailUrl")]
        public Uri ThumbnailUrl { get; internal set; }
    }

    /// <summary>
    /// Interests of an Orkut Person
    /// </summary>
    public class Interests
    {
        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        [JsonProperty(PropertyName = "value")]
        public string Value { get; set; }

        /// <summary>
        /// Gets or sets the display value.
        /// </summary>
        /// <value>The display value.</value>
        [JsonProperty(PropertyName = "displayValue")]
        public string DisplayValue { get; set; }
    }

    /// <summary>
    /// Emails of User
    /// </summary>
    public class Emails
    {
        /// <summary>
        /// Gets or sets the email addresses.
        /// </summary>
        /// <value>The email addresses.</value>
        [JsonProperty(PropertyName = "value")]
        public string EmailAddresses { get; set; }

        /// <summary>
        /// Gets or sets the type of the email.
        /// </summary>
        /// <value>The type of the email.</value>
        [JsonProperty(PropertyName = "type")]
        public string EmailType { get; set; }
    }

    /// <summary>
    /// Addresses of user
    /// </summary>
    public class Address
    {
        /// <summary>
        /// Gets or sets the region.
        /// </summary>
        /// <value>The region.</value>
        [JsonProperty(PropertyName = "region")]
        public string Region { get; set; }

        /// <summary>
        /// Gets or sets the locality.
        /// </summary>
        /// <value>The locality.</value>
        [JsonProperty(PropertyName = "locality")]
        public string Locality { get; set; }

        /// <summary>
        /// Gets or sets the longitude.
        /// </summary>
        /// <value>The longitude.</value>
        [JsonProperty(PropertyName = "longitude")]
        public string Longitude { get; set; }

        /// <summary>
        /// Gets or sets the latitude.
        /// </summary>
        /// <value>The latitude.</value>
        [JsonProperty(PropertyName = "latitude")]
        public string Latitude { get; set; }

        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>The type.</value>
        [JsonProperty(PropertyName = "type")]
        public string Type { get; set; }

        /// <summary>
        /// Gets or sets the _country.
        /// </summary>
        /// <value>The _country.</value>
        [JsonProperty(PropertyName = "country")]
        internal string _country
        {
            get { return StringEnum.GetStringValue(Country); }
            set { Country = StringEnum.GetEnumValue(value); }
        }

        /// <summary>
        /// Gets or sets the country.
        /// </summary>
        /// <value>The country.</value>
        public CountryName Country { get; set; }
    }

    /// <summary>
    /// Phone numbers of user
    /// </summary>
    public class PhoneNumbers
    {
        /// <summary>
        /// Gets or sets the phone number.
        /// </summary>
        /// <value>The phone number.</value>
        [JsonProperty(PropertyName = "value")]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// Gets or sets the type of the phone.
        /// </summary>
        /// <value>The type of the phone.</value>
        [JsonProperty(PropertyName = "type")]
        public string PhoneType { get; set; }
    }

    /// <summary>
    /// Urls of User
    /// </summary>
    public class Urls
    {
        /// <summary>
        /// Gets or sets the URL value.
        /// </summary>
        /// <value>The URL value.</value>
        [JsonProperty(PropertyName = "value")]
        public string UrlValue { get; set; }

        /// <summary>
        /// Gets or sets the type of the URL.
        /// </summary>
        /// <value>The type of the URL.</value>
        [JsonProperty(PropertyName = "type")]
        public string UrlType { get; set; }
    }
}
